package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TestSysPaperMapper;
import com.ruoyi.system.domain.TestSysPaper;
import com.ruoyi.system.service.ITestSysPaperService;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.uuid.IdWorker;
/**
 * 机组信息表Service业务层处理
 *
 * @author ruoyi
 * @date 2025-09-23
 */
@Service
public class TestSysPaperServiceImpl implements ITestSysPaperService
{
    @Autowired
    private TestSysPaperMapper testSysPaperMapper;


    @Autowired
    private IdWorker idWorker;

    /**
     * 查询机组信息表
     *
     * @param paperId 机组信息表主键
     * @return 机组信息表
     */
    @Override
    public TestSysPaper selectTestSysPaperByPaperId(Long paperId)
    {
        return testSysPaperMapper.selectTestSysPaperByPaperId(paperId);
    }

    /**
     * 查询机组信息表列表
     *
     * @param testSysPaper 机组信息表
     * @return 机组信息表
     */
    @Override
    public List<TestSysPaper> selectTestSysPaperList(TestSysPaper testSysPaper)
    {
        return testSysPaperMapper.selectTestSysPaperList(testSysPaper);
    }

    /**
     * 新增机组信息表
     *
     * @param testSysPaper 机组信息表
     * @return 结果
     */
    @Override
    public int insertTestSysPaper(TestSysPaper testSysPaper)
    {
        long newId = idWorker.nextId();
        testSysPaper.setPaperId(newId);
        testSysPaper.setCreateTime(DateUtils.getNowDate());
        return testSysPaperMapper.insertTestSysPaper(testSysPaper);
    }

    /**
     * 修改机组信息表
     *
     * @param testSysPaper 机组信息表
     * @return 结果
     */
    @Override
    public int updateTestSysPaper(TestSysPaper testSysPaper)
    {
        testSysPaper.setUpdateTime(DateUtils.getNowDate());
        return testSysPaperMapper.updateTestSysPaper(testSysPaper);
    }

    /**
     * 批量删除机组信息表
     *
     * @param paperIds 需要删除的机组信息表主键
     * @return 结果
     */
    @Override
    public int deleteTestSysPaperByPaperIds(String paperIds)
    {
        return testSysPaperMapper.deleteTestSysPaperByPaperIds(Convert.toStrArray(paperIds));
    }

    /**
     * 删除机组信息表信息
     *
     * @param paperId 机组信息表主键
     * @return 结果
     */
    @Override
    public int deleteTestSysPaperByPaperId(Long paperId)
    {
        return testSysPaperMapper.deleteTestSysPaperByPaperId(paperId);
    }
}
